#include <stdio.h>

int main(){
    int numCnt; scanf("%d",&numCnt);
    int arr[numCnt];
    for (int i = 0; i < numCnt; i++) { scanf("%d", &arr[i]); }
    int target; scanf("%d", &target);
    int indexL = 0;
    int indexR = numCnt-1;
    int midL, midR;
    int result = -1;
    while (indexL < indexR) {
        midL = indexL + (indexR - indexL) / 3;
        midR = indexR - (indexR - indexL) / 3;
        if (target > arr[indexR] || target < arr[indexL] || midL == midR) { break; }
        if (arr[midL] == target) {
            result = midL; break;
        }
        if (arr[midR] == target) {
            result = midR; break;
        }
        if (target < arr[midL]) {
            indexR = midL - 1;
        }
        else if (target > arr[midR]) {
            indexL = midR + 1;
        }
        else if (target > arr[midL] && target < arr[midR]) {
            indexL = midL + 1;
            indexR = midR - 1;
        }
    }
    printf("%d in [%d]", target, result);
    return 0;
}